<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contact | Craft and talk</title>
<?php
include 'head.php';
?>
</head>
<body>
<?php
include 'nav.php';
?>
<div id="wrapper">
<div id="content">
<h1>Contact</h1>
<?php
if(isSet($_POST['email']) && isSet($_POST['name']) && isSet($_POST['content'])){
	$email = "kvbhat@craftntalk.com";
	$from = $_POST['email'];
	$mail_subject    = "Contact form: "; 
	if(isSet($_POST['subject'])){
		$mail_subject .= $_POST['subject'];
	}
	
	$mail_message    ="<h3>Message from {$_POST['name']}</h3><p>".stripslashes($_POST['content'])."</p>";

	$mail_headers    = "From: {$from}" . "\r\n". 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

	$mail_parameters = ""; 
	
	ini_set('sendmail_from',"webmaster@".$_SERVER['SERVER_NAME']); 

	$result = mail($email,$mail_subject,$mail_message,$mail_headers,$mail_parameters); 
	
	die("Thank you!");
}
?>
In case you want to contact me, either mail me at <em><a href="mailto:kvbhat@craftntalk.com">kvbhat@craftntalk.com</a></em> or use the form below:
<form id="subscribe" name="subscribe" method="post" action="">
<table id="subscribeForm">
	<tr>
		<td><input class="txt" type="text" name="name" value="Your Name"></input></td>
	</tr>
	<tr>
		<td><input class="txt" type="text" name="email" value="Your Email"></input></td>
	</tr>
		<tr>
		<td><input class="txt" type="text" name="subject" value="Subject"></input></td>
	</tr>
	<tr>
		<td><textarea class="txt" style="width:320%;height:290px;" name="content">What do you want to say?</textarea></td>
	</tr>
	<tr>
		<td><input type="submit" value="Send"></input></td>
	</tr>
<table>
</form>
</table>
</div>
</div>
<?php
include 'footer.php';
?>
<script type="text/javascript">

$(document).ready(function() {
    $("#subscribe").validate({
	rules: {
		name: {
		required: true
		},
		email: {
		required: true,
		email: true
		},
		content:{
		required: true
		}
	}
});
});

$("textarea, .txt")
  .focus(function() {
        if (this.value === this.defaultValue) {
            this.value = '';
        }
  })
  .blur(function() {
        if (this.value === '') {
            this.value = this.defaultValue;
        }
});


</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="js/jQuery.Validate.min.js"></script>

</body>
</html>